package com.neusoft.cloudstreamfeign.feign;

import com.neusoft.cloudstreamfeign.config.FeignConfig;
import com.neusoft.cloudstreamfeign.dto.DeliveryProcess;
import com.neusoft.cloudstreamfeign.dto.Result;
import com.neusoft.cloudstreamfeign.dto.RouteInfo;
import com.neusoft.cloudstreamfeign.dto.RouteProcess;
import com.neusoft.cloudstreamfeign.param.DeliverInfoCreatOrUpdateParam;
import com.neusoft.cloudstreamfeign.param.DeliverInfoDeleteParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 物流服务Feign客户端
 */

@FeignClient(
        name = "cloud-stream-service",
        contextId = "deliveryServiceClient",
        path = "/api/stream",
        fallback = DeliveryServiceFallback.class,
        configuration = FeignConfig.class
)
public interface DeliveryServiceClient {
    @GetMapping("/deliveryInfo/list")
    Result list(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize);

    @PostMapping("/deliveryInfo/create")
    Result create(@RequestBody DeliverInfoCreatOrUpdateParam deliveryInfo);

    @PostMapping("/deliveryInfo/update")
    Result update(@RequestBody DeliverInfoCreatOrUpdateParam deliveryInfo);

    @PostMapping("/deliveryInfo/delete")
    Result delete(@RequestBody DeliverInfoDeleteParam deliverInfoDeleteParam);

    @GetMapping("/deliveryInfo/status")
    Result listByStatus(@RequestParam("status") Integer status, @RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize);

    @GetMapping("/deliveryInfo/order")
    Result getByOrderNumber(@RequestParam("orderNumber") String orderNumber);

    @GetMapping("/deliveryProcess/list")
    Result list1(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize, @RequestParam(value = "deliveryId", required = false) Long deliveryId);

    @PostMapping("/deliveryProcess/create")
    Result create1(@RequestBody DeliveryProcess deliveryProcess);

    @PostMapping("/deliveryProcess/update")
    Result update1(@RequestBody DeliveryProcess deliveryProcess);

    @PostMapping("/deliveryProcess/delete")
    Result delete1(@RequestBody DeliveryProcess deliveryProcess);

    @GetMapping("/routeInfo/list")
    Result list2(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize, @RequestParam(value = "routeCode", required = false) String routeCode);

    @PostMapping("/routeInfo/create")
    Result create2(@RequestBody RouteInfo routeInfo);

    @PostMapping("/routeInfo/update")
    Result update2(@RequestBody RouteInfo routeInfo);

    @PostMapping("/routeInfo/delete")
    Result delete2(@RequestBody RouteInfo routeInfo);

    @GetMapping("/routeProcess/list")
    Result list3(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize,
                 @RequestParam(value = "deliveryId", required = false) Long deliveryId, @RequestParam(value = "routeId", required = false) Long routeId);

    @PostMapping("/routeProcess/create")
    Result create3(@RequestBody RouteProcess routeProcess);

    @PostMapping("/routeProcess/update")
    Result update3(@RequestBody RouteProcess routeProcess);

    @PostMapping("/routeProcess/delete")
    Result delete3(@RequestBody RouteProcess routeProcess);

}
